import type { AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios';

// 扩充CreateAxiosDefaults类型
interface Iinterceptors {
  // requestSuccessFn?: (req: AxiosRequestConfig) => AxiosRequestConfig
  requestSuccessFn?: (req: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;

  requestFailureFn?: (err: any) => any;
  responeseSuccessFn?: (res: AxiosResponse) => AxiosResponse;
  responeseFailureFn?: (err: any) => any;
}
export interface IAxiosRequestConfig extends AxiosRequestConfig {
  interceptors?: Iinterceptors;
}

export interface Iresponse<T = any> {
  code: number;
  message: string;
  data?: T;
}
